package com.zhiqianbao.activity;

import android.content.Intent;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.TextView;

import com.zhiqianbao.R;
import com.zhiqianbao.utils.Constants;


/**
 * Created by liang on 2016/10/10.
 */
public class PhoneCheckInfoActivity extends BaseActivity {

    WebView mWebView;
    TextView textviewRegisterTitle;

    String url;
    String title;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_phone_check_info);
        Intent intent = getIntent();
        url = (String) intent.getSerializableExtra("url");
        title = (String) intent.getSerializableExtra("title");

        init();
        initView();
    }

    private void initView() {
         mWebView=(WebView)findViewById(R.id.mWebView);
         textviewRegisterTitle=(TextView)findViewById(R.id.textview_register_title);
        WebSettings webSettings = mWebView.getSettings();
        //设置WebView属性，能够执行Javascript脚本
        webSettings.setJavaScriptEnabled(false);
        //设置可以访问文件
        webSettings.setAllowFileAccess(false);
        //设置支持缩放
        webSettings.setBuiltInZoomControls(false);
        //加载需要显示的网页
        mWebView.loadUrl(Constants.API_ROOT + url);
        //设置Web视图
        mWebView.setWebViewClient(new WebViewClient());
        textviewRegisterTitle.setText(title);
    }
}
